<template>
  <template v-if="props.column.dataIndex === 'actions'">
    <a-button type="link" :size="'small'" @click="emits('actions-edit', props.record)"
      >编辑
    </a-button>
    <a-button danger type="link" :size="'small'" @click="emits('actions-delete', props.record)"
      >删除
    </a-button>
  </template>
  <template v-else>
    {{ props.text }}
  </template>
</template>

<script setup lang="ts">
import { defineEmits, defineProps } from 'vue'

export interface TableActionsProps {
  column: Record<string, string>
  record: Record<string, string>
  index: number
  text: string
  defaultRoleList: Record<string, string>[]
}

const props = defineProps<TableActionsProps>()
const emits = defineEmits(['actions-edit', 'actions-delete','editOk'])

defineOptions({
  name: 'ActionsBtn',
})
</script>
